package cos.android.sprites;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class Arrow extends Element {

	public Arrow(Bitmap sprite, int xPos, int yPos, int height, int width) {
		super(sprite, xPos, yPos, height, width);
		
		Rect rect = getRect();
		rect.left = 0;
		rect.right = rect.left + width;
		rect.top = 0;
		rect.bottom = rect.top + height;
		setRect(rect);
		
	}

	@Override
	public void draw(Canvas canvas) {
		Rect dest = new Rect( Math.round(getxPos()), Math.round(getyPos()), Math.round(getxPos() + getWidth()),
				Math.round(getyPos() + getHeight()));
		canvas.drawBitmap(getSprite(), getRect(), dest, null);	
	}

}
